package com.tong.hao.batch.step.test;

import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.item.ItemWriter;

import java.util.List;

/**
 * @ClassName StringWriter
 * @Author 友野浩二
 * @Date 2019/11/25 21:50
 * @Description Step第三步: 数据写入阶段ItemWriter
 * @Version 1.0
 *
 * <pre>
 *      数据处理完成后,会统一交给写组件(ItemWriter)进行写入。
 * </pre>
 */
@Slf4j
public class StringWriter implements ItemWriter<String> {

    @Override
    public void write(List<? extends String> list) throws Exception {
        list.forEach(o -> log.info("write data: " + o));
    }
}
